package com.sleep.drug_traceability.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sleep.drug_traceability.dao.pojo.User;
import com.sleep.drug_traceability.vo.UserTableVo;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Sleep-6000
 * @date 2022/4/23
 */
@Repository
public interface UserMapper extends BaseMapper<User> {

    @Select("select u.username, u.type, u.phone_number, u.user_status, m.name, m.legal, m.address " +
            "from user u , man_info m " +
            "where u.id = m.user_id " +
            "and u.type <> 3")
    List<UserTableVo> getManUser();

    @Select("select u.username, u.type, u.phone_number, u.user_status, s.name,s.legal, s.address " +
            "from user u , sel_info s " +
            "where u.id = s.user_id " +
            "and u.type <> 3")
    List<UserTableVo> getSelUser();
}
